


import java.awt.Color;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Tomasz
 */
public class MessageBox {
       
    JFrame fr;
    public MessageBox(String info)
    {
               fr  = new JFrame() ;
    
  //  Container content = f.getContentPane();
    final JPanel content = new JPanel(); 
    
    
    
    content.setBackground(Color.white);
    content.setBackground(Color.white);
    content.setLayout(new GridLayout(0,2));
    JLabel l = new JLabel(info); 
    JButton ok = new JButton("OK");
    ok.addActionListener(new ActionListener() {

                @Override
                public void actionPerformed(ActionEvent e) {
                 fr.hide();  
                }


            });
    content.add(l);
    content.add(ok);
    fr.add(content);
    fr.setSize(900, 200);

    }
public void show()
{
        fr.show();
}
    
}
